package net.wofly.sale.report.service;

import net.wofly.common.persistence.PageWrapper;
import net.wofly.common.util.ReturnBean;
import net.wofly.sale.report.domain.SaleDailyReport;
import net.wofly.sale.report.dto.DailyReportDetailDTO;
import net.wofly.sale.report.dto.StockDTO;

import java.util.List;

public interface ISaleDailyReportService {

	/**
	 * 增加或修改
	 * 
	 * @param entity
	 * @return
	 */
	public SaleDailyReport save(SaleDailyReport entity);

	/**
	 * 删除
	 * 
	 * @param entity
	 * @return
	 */
	public void delete(SaleDailyReport entity);

	/**
	 * 根据主键ID删除
	 * 
	 * @param key
	 * @return
	 */
	public void delete(String key);

	/**
	 * 根据主键查询
	 * 
	 * @param key
	 * @return
	 */
	public SaleDailyReport findOne(String key);
	
	public List<SaleDailyReport> save(List<SaleDailyReport> entityList) ;
	
	/**
	 * 根据日期查询日报
	 * @param countDate
	 * @return
	 */
	public ReturnBean<PageWrapper<SaleDailyReport>> findSaleDailyReportByDate(Long countDate,Integer pageNum, Integer pageSize) throws InterruptedException;
	
	/**
	 * 根据日期查询我的日报
	 * @param countDate
	 * @return
	 */
	public ReturnBean<SaleDailyReport> findMyDailyReportByDate(String userID ,Long countDate) ;
	
	
	/**
	 * 根据时间生成日报
	 * @param countDate
	 */
	public void generateSaleDailyReport(Long countDate);

	/**
	 * 查询日报详情
	 *
	 * @param userID
	 * @param countDate
     * @return
     */
	ReturnBean<DailyReportDetailDTO> getSaleDailyReportDetail(String userID, Long countDate);

	/**
	 * 业务经理出库汇总
	 * @param countDate
	 * @return
     */
	ReturnBean<List<StockDTO>> managerOutStockSummary(Long countDate);

	/**
	 * 店面出库汇总
	 * @param countDate
	 * @return
	 */
	ReturnBean<List<StockDTO>> storeOutStockSummary(Long countDate);

	/**
	 * 业务经理入库汇总
	 * @param countDate
	 * @return
	 */
	ReturnBean<List<StockDTO>> managerInStockSummary(Long countDate);

	/**
	 * 店面入库汇总
	 * @param countDate
	 * @return
	 */
	ReturnBean<List<StockDTO>> storeInStockSummary(Long countDate);

	/**
	 * 每日终端商品出库汇总
	 * @param countDate
	 * @return
	 */
	ReturnBean<List<StockDTO>> commodityTerminalOutStockSummary(Long countDate);

	/**
	 * 每日终端商品个人仓库出库汇总
	 * @param warehouseID
	 * @param countDate
	 * @return
	 */
	ReturnBean<List<StockDTO>> commodityTerminalOutStockSummary(String warehouseID, Long countDate);
}
